{
    "type": "Ext.container.Viewport",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "id": "login",
        "designer|userClassName": "login",
        "designer|initialView": true,
        "layout": "border"
    },
    "designerId": "1e1dfc9c-623f-4953-ba27-8daee3faced5",
    "cn": [
        {
            "type": "Ext.panel.Panel",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "layout|region": "east",
                "designer|snapToGrid": 10,
                "width": 292,
                "designer|userClassName": "MyPanel3",
                "layout": "absolute",
                "bodyBorder": false,
                "title": ""
            },
            "designerId": "a47fa570-1b3a-444c-a9a0-16654d938ad3",
            "cn": [
                {
                    "type": "Ext.panel.Panel",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|x": 0,
                        "layout|y": 200,
                        "designer|snapToGrid": 10,
                        "height": 160,
                        "designer|userClassName": "MyPanel13",
                        "layout": "absolute",
                        "header": false,
                        "title": "My Panel"
                    },
                    "designerId": "001741d9-7813-4862-839b-d3b7bf8bd55c",
                    "cn": [
                        {
                            "type": "Ext.form.field.Text",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "layout|x": 10,
                                "layout|y": 10,
                                "dock": null,
                                "id": "userlogin",
                                "width": 250,
                                "designer|userClassName": "MyTextField2",
                                "designer|displayName": null,
                                "fieldLabel": "",
                                "allowBlank": false,
                                "blankText": "Este campo es requerido",
                                "emptyText": "Usuario"
                            },
                            "designerId": "78fc8bfc-88ea-48b3-9273-4f9fb7a68a6c"
                        },
                        {
                            "type": "Ext.form.field.Text",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "layout|x": 10,
                                "layout|y": 40,
                                "dock": null,
                                "id": "passlogin",
                                "width": 150,
                                "designer|userClassName": "MyTextField3",
                                "fieldLabel": "",
                                "inputType": "password",
                                "allowBlank": false,
                                "blankText": "Este campo es requerido",
                                "emptyText": "Contraseña"
                            },
                            "designerId": "18c0bea1-d98b-45ee-9fb2-a432ce9cdeee"
                        },
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "layout|x": 170,
                                "layout|y": 40,
                                "width": 90,
                                "designer|userClassName": "MyButton15",
                                "text": "Ingresar"
                            },
                            "designerId": "57c880c2-6a6b-44e4-9142-2278e62222b1",
                            "cn": [
                                {
                                    "type": "basicfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|userClassName": "handler",
                                        "fn": "handler",
                                        "designer|params": [
                                            "item, event"
                                        ],
                                        "implHandler": [
                                            "Ext.Ajax.request({ ",
                                            "    url: '/login',   ",
                                            "    method:'GET',  ",
                                            "    params:{",
                                            "        uid:Ext.getCmp('userlogin').getValue(),",
                                            "        pwd:Sha1.hash(Ext.getCmp('passlogin').getValue()",
                                            "    )}, ",
                                            "    success: function(response,options){",
                                            "        var json = Ext.decode(response.responseText);",
                                            "        //BubbleMsg.msg('Administración de Proyectos Pheta Manager', json.msg);",
                                            "        if(json.success){",
                                            "            var flag=0;",
                                            "            for(i=0;i<json.permisos.length;i++){",
                                            "                if(json.permisos[i]=='LOGIN'){",
                                            "                    Ext.getCmp('login').removeAll();",
                                            "                    Ext.create('MyApp.view.MyViewport1').show();",
                                            "                    Ext.getCmp('MyViewport1').permisos = json.permisos;",
                                            "                    Ext.getCmp('MyViewport1').user_name = json.user;",
                                            "                    Ext.getCmp('MyViewport1').id_usuario = json.id_usuario;",
                                            "                    Ext.getCmp('user_label').setValue(json.user);",
                                            "                    for(j=0;j<json.permisos.length;j++){",
                                            "                        if(json.permisos[j]=='ABRIR_PROYECTO'){",
                                            "                            var viewport = Ext.getCmp('MyViewport1');",
                                            "                            var abrir_proy = Ext.create('MyApp.view.boton_abrir_proyecto');",
                                            "                            var cerrar_proy = Ext.create('MyApp.view.boton_cerrar_proyecto');",
                                            "                            var proyectoactual = Ext.create('MyApp.view.proyectoactual_label');   ",
                                            "                            viewport.getComponent('proyecto_toolbar').add(abrir_proy);",
                                            "                            viewport.getComponent('proyecto_toolbar').add(cerrar_proy);",
                                            "                            viewport.getComponent('proyecto_toolbar').add(proyectoactual);",
                                            "                            viewport.doLayout();",
                                            "                            j=json.permisos.length;",
                                            "                        }",
                                            "                    }",
                                            "                    flag=1;",
                                            "                    i=json.permisos.length;",
                                            "                }",
                                            "            }",
                                            "            if(flag==0){",
                                            "                Ext.MessageBox.show({",
                                            "                    title: 'ERROR', ",
                                            "                    msg: 'El usuario no posee permisos o usuario esta inactivo',",
                                            "                    buttons: Ext.MessageBox.OK,",
                                            "                    icon: Ext.MessageBox.ERROR,",
                                            "                    fn: null,",
                                            "                    animEl: 'main',",
                                            "                    closable: false",
                                            "                });",
                                            "            }",
                                            "",
                                            "        } else{",
                                            "            Ext.MessageBox.show({",
                                            "                title: 'ERROR', ",
                                            "                msg: json.msg,",
                                            "                buttons: Ext.MessageBox.OK,",
                                            "                icon: Ext.MessageBox.ERROR,",
                                            "                fn: null,",
                                            "                animEl: 'main',",
                                            "                closable: false",
                                            "            });",
                                            "        } ",
                                            "    }, ",
                                            "    failure: function(response,options){  ",
                                            "        var el = Ext.get('response');  ",
                                            "    }, ",
                                            "    scope:this",
                                            "});  "
                                        ]
                                    },
                                    "designerId": "2ccc8782-0c7f-45ff-b324-34884163feb8"
                                }
                            ]
                        },
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "layout|x": 10,
                                "layout|y": 70,
                                "width": 250,
                                "designer|userClassName": "MyButton12",
                                "text": "Olvide mi contraseña?"
                            },
                            "designerId": "97eb8c60-e55b-47ec-b995-5d6671b903ee",
                            "cn": [
                                {
                                    "type": "basicfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|userClassName": "handler",
                                        "fn": "handler",
                                        "designer|params": [
                                            "button, event"
                                        ],
                                        "implHandler": [
                                            "Ext.create('MyApp.view.restablecer_pass_window').show();"
                                        ]
                                    },
                                    "designerId": "425920d6-b5ec-42ad-ab75-d99952145353"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "Ext.Img",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "layout|region": "center",
                "designer|userClassName": "MyImg",
                "src": "/static/images/gestion-de-proyectos.jpg"
            },
            "designerId": "9b7226f5-57d6-44a4-9e59-cc92c344969c"
        },
        {
            "type": "Ext.toolbar.Toolbar",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "layout|region": "north",
                "height": 41,
                "style": [
                    "background-color: #000000;"
                ],
                "designer|userClassName": "MyToolbar1"
            },
            "designerId": "629b8354-f954-4c0d-995c-5c70f79b6d14",
            "cn": [
                {
                    "type": "Ext.form.Label",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 20,
                        "style": [
                            "color: #FFFFFF;",
                            ""
                        ],
                        "width": 254,
                        "designer|userClassName": "MyLabel",
                        "text": "           Administrador de Proyectos Pheta - Manager"
                    },
                    "designerId": "e5357c04-85d4-4ab1-a7e9-573d503d1f28"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 19,
                        "width": 25,
                        "designer|userClassName": "MyImg1",
                        "src": "/static/images/onlinelogomaker-Grande.png"
                    },
                    "designerId": "cdf98334-8a54-4769-95ea-d6651ff324b5"
                }
            ]
        },
        {
            "type": "Ext.toolbar.Toolbar",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "layout|region": "south",
                "height": 52,
                "hidden": true,
                "style": [
                    "background-color: #000000;"
                ],
                "designer|userClassName": "MyToolbar6"
            },
            "designerId": "a484103e-df07-40f9-977a-2ad46418cd0a",
            "cn": [
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/pythonimg.jpeg"
                    },
                    "designerId": "295f8dde-a060-449d-8fad-ce96fb7aae59"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/extjsimg.jpeg"
                    },
                    "designerId": "17964298-e615-4f85-88a7-f3b1396eff71"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/flaskimg.jpeg"
                    },
                    "designerId": "49a07e5b-e8c2-4b2c-87b9-8c55cf5d20b1"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/postgresimg.jpeg"
                    },
                    "designerId": "cca66cba-ab63-433c-9a91-8a5ae91c1fbf"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/eclipseimg.jpeg"
                    },
                    "designerId": "a0790b92-addd-41bb-b747-d02d342e55ce"
                },
                {
                    "type": "Ext.Img",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "layout|flex": null,
                        "height": 45,
                        "width": 210,
                        "designer|userClassName": "MyImg2",
                        "src": "/static/images/diaimg.jpeg"
                    },
                    "designerId": "6b486777-c789-4937-9061-eb67f99157d4"
                }
            ]
        }
    ]
}